home *** CD-ROM | disk | FTP | other *** search
- Could you help me with this one:
-
- I need a fast line drawing routine for my next game (faster than on any extensions).
- I have tried to do it on my own but failed more than once. I found routine called
- "Simpleline" from the "Amiga Hardware Reference Manual", I have compiled it and tried
- to use it with Amos, but nothing will happen:(((
-
- The routine needs following values:
- D0/D1 = X1/Y1
- D2/D3 = X2/Y2
- D4 = Planewidth in bytes
- A0 = Planepointer
-
- I'm using a following program:
-
- Screen Open 0,320,200,16,Lowres
- Cls 0
- PLoad "simpleline",10
- DReg(0)=1:Dreg(1)=1:Dreg(2)=200:Dreg(3)=100:Dreg(4)=40:Areg(0)=Phybase(0)
- Call 10
-
- Timer shows that something happens but there are no line on a screen.
- It may be a little stupid thing I do wrong and I may be stupid for not
- noticing it. This thing drives me mad. So I beg you, please help (It
- ain't nice to be stupid and mad at the same time).
-
- I've included the asm source for you to look at. Sorry for the length,
- I promise I won't bother you anymore...
-
- include "Work:Sources/Exec/types.i"
- include "Work:Sources/Hardware/custom.i"
- include "Work:Sources/Hardware/blit.i"
- include "Work:Sources/Hardware/dmabits.i
-
- xref _custom
- xdef simpleline
-
- simpleline:
- lea _custom,a1
- sub.w d0,d2
- bmi xneg
- sub.w d1,d3
- bmi yneg
- cmp.w d3,d2
- bmi ygtx
- moveq.l #OCTANT1+LINEMODE,d5
- bra lineagain
- ygtx:
- exg d2,d3
- moveq.l #OCTANT2+LINEMODE,d5
- bra lineagain
- yneg:
- neg.w d3
- cmp.w d3,d2
- bmi ynygtx
- moveq.l #OCTANT8+LINEMODE,d5
- bra lineagain
- ynygtx:
- exg d2,d3
- moveq.l #OCTANT7+LINEMODE,d5
- bra lineagain
- xneg:
- neg.w d2
- sub.w d1,d3
- bmi xyneg
- cmp.w d3,d2
- bmi xnygtx
- moveq.l #OCTANT4+LINEMODE,d5
- bra lineagain
- xnygtx:
- exg d2,d3
- moveq.l #OCTANT3+LINEMODE,d5
- bra lineagain
- xyneg:
- neg.w d3
- cmp.w d3,d2
- bmi xynygtx
- moveq.l #OCTANT5+LINEMODE,d5
- bra lineagain
- xynygtx:
- exg d2,d3
- moveq.l #OCTANT6+LINEMODE,d5
- lineagain:
- mulu.w d4,d1
- ror.l #4,d0
- add.w d0,d0
- add.l d1,a0
- add.w d0,a0
- swap d0
- or.w #$bfa,d0
- lsl.w #2,d3
- add.w d2,d2
- move.w d2,d1
- lsl.w #5,d1
- add.w #$42,d1
- btst #DMAB_BLTDONE-8,dmaconr(a1)
- waitblit:
- btst #DMAB_BLTDONE-8,dmaconr(a1)
- bne waitblit
- move.w d3,bltbmod(a1)
- sub.w d2,d3
- ext.l d3
- move.l d3,bltapt(a1)
- bpl lineover
- or.w #SIGNFLAG,d5
- lineover:
- move.w d0,bltcon0(a1)
- move.w d5,bltcon1(a1)
- move.w d4,bltcmod(a1)
- move.w d4,bltdmod(a1)
- sub.w d2,d3
- move.w d3,bltamod(a1)
- move.w #$8000,bltadat(a1)
- moveq.l #-1,d5
- move.l d5,bltafwm(a1)
- move.l a0,bltcpt(a1)
- move.l a0,bltdpt(a1)
- move.w d1,bltsize(a1)
- rts
- end
-
- SLin
-
-
-
-
-
-
-